home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / u_man / cat1 / ex.z / ex
Text File  |  1998-10-20  |  22KB  |  400 lines

  1.  
  2.  
  3.  
  4. eeeexxxx((((1111))))                                                                    eeeexxxx((((1111))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ex - text editor
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      eeeexxxx [----ssss] [----llll] [----LLLL] [----RRRR] [----rrrr file] [----tttt tag] [----vvvv] [----VVVV] [----xxxx] [----CCCC] [++++ command]
  13.      [----cccc command] [----wwww size] file ...
  14.  
  15. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  16.      _e_x is the root of a family of editors:  _e_x and _v_i.  _e_x is a superset of
  17.      _e_d, with the most notable extension being a display editing facility.
  18.      Display based editing is the focus of _v_i.
  19.  
  20.      If you use a window or a CRT terminal, you may wish to use the _v_i(1)
  21.      editor, which focuses on the display-editing portion of _e_x.
  22.  
  23.    FFFFoooorrrr eeeedddd UUUUsssseeeerrrrssss
  24.      If you have used _e_d(1) you will find that, in addition to having all of
  25.      the _e_d(1) commands available, _e_x has a number of additional features
  26.      useful on CRT terminals.  Intelligent terminals and high speed terminals
  27.      are very pleasant to use with _v_i.  Generally, the _e_x editor uses far more
  28.      of the capabilities of terminals than _e_d(1) does and uses the terminal
  29.      capability data base (see _t_e_r_m_i_n_f_o(4)) and the type of the terminal you
  30.      are using from the environment variable TERM to determine how to drive
  31.      your terminal efficiently.  The editor makes use of features such as
  32.      insert and delete character and line in its vvvviiiissssuuuuaaaallll command (which can be
  33.      abbreviated vvvviiii) and which is the central mode of editing when using
  34.      _v_i(1).
  35.  
  36.      _e_x contains a number of features for easily viewing the text of the file.
  37.      The zzzz command gives easy access to windows of text.  Typing ^^^^DDDD (control-
  38.      d) causes the editor to scroll a half-window of text and is more useful
  39.      for quickly stepping through a file than just typing return.  Of course,
  40.      the screen-oriented vvvviiiissssuuuuaaaallll mode gives constant access to editing context.
  41.  
  42.      _e_x gives you help when you make mistakes.  The uuuunnnnddddoooo (uuuu) command allows
  43.      you to reverse any single change that goes astray.  _e_x gives you a lot of
  44.      feedback, normally printing changed lines, and indicates when more than a
  45.      few lines are affected by a command so that it is easy to detect when a
  46.      command has affected more lines than it should have.
  47.  
  48.      The editor also normally prevents overwriting existing files, unless you
  49.      edited them, so that you do not accidentally overwrite a file other than
  50.      the one you are editing.  If the system (or editor) crashes, or you
  51.      accidentally hang up the telephone, you can use the editor rrrreeeeccccoooovvvveeeerrrr
  52.      command (or ----rrrr _f_i_l_e option) to retrieve your work.  This gets you back to
  53.      within a few lines of where you left off.
  54.  
  55.      _e_x has several features for dealing with more than one file at a time.
  56.      You can give it a list of files on the command line and use the nnnneeeexxxxtttt (nnnn)
  57.      command to deal with each in turn.  The nnnneeeexxxxtttt command can also be given a
  58.      list of filenames, or a pattern as used by the shell to specify a new set
  59.      of files to be dealt with.  In general, filenames in the editor can be
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. eeeexxxx((((1111))))                                                                    eeeexxxx((((1111))))
  71.  
  72.  
  73.  
  74.      formed with full shell metasyntax.  The metacharacter %%%% is also available
  75.      in forming filenames and is replaced by the name of the current file.
  76.      For editing large groups of related files you can use _e_x's ttttaaaagggg command to
  77.      quickly locate functions and other important points in any of the files.
  78.      This is useful when working on a large program when you want to quickly
  79.      find the definition of a particular function.  The _c_t_a_g_s(1) utility
  80.      builds a _t_a_g_s file for C, Pascal, and FORTRAN programs.
  81.  
  82.      The editor has a group of buffers whose names are the ASCII lower-case
  83.      letters (aaaa-zzzz).  You can place text in these named buffers where it is
  84.      available to be inserted elsewhere in the file.  The contents of these
  85.      buffers remain available when you begin editing a new file using the eeeeddddiiiitttt
  86.      (eeee) command.
  87.  
  88.      There is a command &&&& in _e_x that repeats the last ssssuuuubbbbssssttttiiiittttuuuutttteeee command.  In
  89.      addition, there is a confirmed substitute command.  You give a range of
  90.      substitutions to be done and the editor interactively asks whether each
  91.      substitution is desired.
  92.  
  93.      It is possible to ignore the case of letters in searches and
  94.      substitutions.  _e_x also allows regular expressions that match words to be
  95.      constructed.  This is convenient, for example, in searching for the word
  96.      eeeeddddiiiitttt if your document also contains the word eeeeddddiiiittttoooorrrr.  See the rrrreeeeggggccccoooommmmpppp(5)
  97.      man page for information about using the regular expression syntax.  This
  98.      version of _e_x is X/Open compliant and uses the X/Open defined regular
  99.      expression syntax.
  100.  
  101.      _e_x has a set of options that you can set to tailor it to your liking.
  102.      One option that is very useful is the aaaauuuuttttooooiiiinnnnddddeeeennnntttt option that allows the
  103.      editor to supply leading white space to align text automatically.  You
  104.      can then use ^^^^DDDD as a backtab and space or tab to move forward to align
  105.      new code easily.
  106.  
  107.      Miscellaneous useful features include an intelligent jjjjooooiiiinnnn (jjjj) command
  108.      that supplies white space between joined lines automatically, commands <<<<
  109.      and >>>> that shift groups of lines, and the ability to filter portions of
  110.      the buffer through commands such as _s_o_r_t(1).
  111.  
  112.    IIIInnnnvvvvooooccccaaaattttiiiioooonnnn OOOOppppttttiiiioooonnnnssss
  113.      The following invocation options are interpreted by _e_x (previously
  114.      documented options are discussed in the NNNNOOOOTTTTEEEESSSS section at the end of this
  115.      manual page):
  116.  
  117.      ----ssss           Suppress all interactive-user feedback.  This is useful in
  118.                   processing editor scripts.
  119.  
  120.      ----llll           Set lisp mode; indents appropriately for Lisp code; the (),
  121.                   {}, [[[[[[[[ and ]]]]]]]] commands in visual mode are modified to have
  122.                   meaning for Lisp.
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. eeeexxxx((((1111))))                                                                    eeeexxxx((((1111))))
  137.  
  138.  
  139.  
  140.      ----LLLL           List the names of all files saved as the result of an editor
  141.                   or system crash.
  142.  
  143.      ----RRRR           RRRReeeeaaaaddddoooonnnnllllyyyy mode; the rrrreeeeaaaaddddoooonnnnllllyyyy flag is set, preventing
  144.                   accidental overwriting of the file.  ----rrrr _f_i_l_e Edit _f_i_l_e after
  145.                   an editor or system crash.  (Recovers the version of _f_i_l_e
  146.                   that was in the buffer when the crash occurred.)
  147.  
  148.      ----tttt _t_a_g       Edit the file containing the _t_a_g and position the editor at
  149.                   its definition.
  150.  
  151.      ----vvvv           Invoke _v_i.
  152.  
  153.      ----xxxx           Encryption option; when used, _e_x simulates an XXXX command and
  154.                   prompts the user for a key.  This key is used to encrypt and
  155.                   decrypt text using the algorithm of _c_r_y_p_t(1).  The XXXX command
  156.                   makes an educated guess to determine whether text read in is
  157.                   encrypted or not.  The temporary buffer file is encrypted
  158.                   also, using a transformed version of the key typed in for
  159.                   the ----xxxx option.  See _c_r_y_p_t(1).
  160.  
  161.      ----CCCC           Encryption option; the same as the ----xxxx option, except that _e_x
  162.                   simulates a CCCC command.  The CCCC command is like the XXXX command,
  163.                   except that all text read in is assumed to have been
  164.                   encrypted.
  165.  
  166.      ++++ _c_o_m_m_a_n_d    Begin editing by executing the specified _e_x command-mode
  167.                   commands.  As with normal editing command-line entries, the
  168.                   _c_o_m_m_a_n_d option-argument can consist of multiple _e_x commands
  169.                   separated by vertical-line characters (|).  The use of
  170.                   commands that enter input or visual modes in this manner
  171.                   produces undefined results.
  172.  
  173.      ----wwww _s_i_z_e      Set the value of the _w_i_n_d_o_w editor option to _s_i_z_e.
  174.  
  175.      ----cccc _c_o_m_m_a_n_d   Begin editing by executing the specified editor _c_o_m_m_a_n_d
  176.                   (usually a search or positioning command).
  177.  
  178.      The _f_i_l_e argument indicates one or more files to be edited.
  179.  
  180.    eeeexxxx SSSSttttaaaatttteeeessss
  181.      Command   Normal and initial state.  Input prompted for by ::::.  Your line
  182.                kill character cancels a partial command.
  183.  
  184.      Insert    Entered by aaaa, iiii, or cccc.  Arbitrary text can be entered.  Insert
  185.                state normally is terminated by a line having only "...."  on it,
  186.                or, abnormally, with an interrupt.
  187.  
  188.      Visual    Entered by typing vvvviiii; terminated by typing QQQQ or ^\ (control-\).
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. eeeexxxx((((1111))))                                                                    eeeexxxx((((1111))))
  203.  
  204.  
  205.  
  206.    eeeexxxx CCCCoooommmmmmmmaaaannnndddd NNNNaaaammmmeeeessss aaaannnndddd AAAAbbbbbbbbrrrreeeevvvviiiiaaaattttiiiioooonnnnssss
  207.      aaaabbbbbbbbrrrreeeevvvv   aaaabbbb        mmmmaaaapppp                   sssseeeetttt          sssseeee
  208.      aaaappppppppeeeennnndddd   aaaa         mmmmaaaarrrrkkkk       mmmmaaaa         sssshhhheeeellllllll        sssshhhh
  209.      aaaarrrrggggssss     aaaarrrr        mmmmoooovvvveeee       mmmm          ssssoooouuuurrrrcccceeee       ssssoooo
  210.      cccchhhhaaaannnnggggeeee   cccc         nnnneeeexxxxtttt       nnnn          ssssuuuubbbbssssttttiiiittttuuuutttteeee   ssss
  211.      ccccooooppppyyyy     ccccoooo        nnnnuuuummmmbbbbeeeerrrr     nnnnuuuu         uuuunnnnaaaabbbbbbbbrrrreeeevvvv     uuuunnnnaaaabbbb
  212.      ddddeeeelllleeeetttteeee   dddd         pppprrrreeeesssseeeerrrrvvvveeee   pppprrrreeee        uuuunnnnddddoooo         uuuu
  213.      eeeeddddiiiitttt     eeee         pppprrrriiiinnnntttt      pppp          uuuunnnnmmmmaaaapppp        uuuunnnnmmmm
  214.      ffffiiiilllleeee     ffff         ppppuuuutttt        ppppuuuu         vvvveeeerrrrssssiiiioooonnnn      vvvveeee
  215.      gggglllloooobbbbaaaallll   gggg         qqqquuuuiiiitttt       qqqq          vvvviiiissssuuuuaaaallll       vvvviiii
  216.      iiiinnnnsssseeeerrrrtttt   iiii         rrrreeeeaaaadddd       rrrr          wwwwrrrriiiitttteeee        wwww
  217.      jjjjooooiiiinnnn     jjjj         rrrreeeeccccoooovvvveeeerrrr    rrrreeeecccc        xxxxiiiitttt          xxxx
  218.      lllliiiisssstttt     llll         rrrreeeewwwwiiiinnnndddd     rrrreeeewwww        yyyyaaaannnnkkkk         yyyyaaaa
  219.  
  220.    eeeexxxx CCCCoooommmmmmmmaaaannnnddddssss
  221.      shell escape           !!!!
  222.      forced encryption      CCCC
  223.      heuristic encryption   XXXX
  224.      lshift                 <<<<
  225.      print next             CR
  226.      resubst                &&&&
  227.      rshift                 >>>>
  228.      scroll                 ^^^^DDDD
  229.      window                 zzzz
  230.  
  231.    eeeexxxx CCCCoooommmmmmmmaaaannnndddd AAAAddddddddrrrreeeesssssssseeeessss
  232.      _n     line _n      ////_p_a_t   next with _p_a_t
  233.      ....     current     ????_p_a_t   previous with _p_a_t
  234.      $$$$     last        _x----_n    _n before _x
  235.      ++++     next        _x,,,,_y    _x through _y
  236.      ----     previous    ''''_x     marked with _x
  237.      ++++_n    _n forward   ''''''''     previous context
  238.      %%%%     1,$
  239.  
  240.    IIIInnnniiiittttiiiiaaaalllliiiizzzziiiinnnngggg ooooppppttttiiiioooonnnnssss
  241.      EEEEXXXXIIIINNNNIIIITTTT         place sssseeeetttt's here in environment variable
  242.      $$$$HHHHOOOOMMMMEEEE////....eeeexxxxrrrrcccc    editor initialization file
  243.      ....////....eeeexxxxrrrrcccc        editor initialization file
  244.      sssseeeetttt _x          enable option _x
  245.      sssseeeetttt nnnnoooo_x        disable option _x
  246.      sssseeeetttt _x====_v_a_l      give value _v_a_l to option _x
  247.      sssseeeetttt            show changed options
  248.      sssseeeetttt aaaallllllll        show all options
  249.      sssseeeetttt _x????         show value of option _x
  250.  
  251.      If the EEEEXXXXIIIINNNNIIIITTTT environment variable is set, initialization options are
  252.      taken from that variable.  Otherwise, initialization options are taken
  253.      from $$$$HHHHOOOOMMMMEEEE////....eeeexxxxrrrrcccc, if it exists.  Finally, if the eeeexxxxrrrrcccc option is set
  254.      (either by EEEEXXXXIIIINNNNIIIITTTT or $$$$HHHHOOOOMMMMEEEE////....eeeexxxxrrrrcccc,) initialization options are taken from
  255.      ....////....eeeexxxxrrrrcccc, if it exists.
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. eeeexxxx((((1111))))                                                                    eeeexxxx((((1111))))
  269.  
  270.  
  271.  
  272.    MMMMoooosssstttt uuuusssseeeeffffuuuullll ooooppppttttiiiioooonnnnssss aaaannnndddd tttthhhheeeeiiiirrrr aaaabbbbbbbbrrrreeeevvvviiiiaaaattttiiiioooonnnnssss
  273.      aaaauuuuttttooooiiiinnnnddddeeeennnntttt   aaaaiiii     supply indent
  274.      aaaauuuuttttoooowwwwrrrriiiitttteeee    aaaawwww     write before changing files
  275.      ddddiiiirrrreeeeccccttttoooorrrryyyy           pathname of directory for temporary work files
  276.                          allow _v_i/_e_x to read the ....eeeexxxxrrrrcccc in the current
  277.                          directory; this option is set in the EEEEXXXXIIIINNNNIIIITTTT shell
  278.                          variable or in the ....eeeexxxxrrrrcccc file in the $$$$HHHHOOOOMMMMEEEE directory
  279.      eeeexxxxrrrrcccc         eeeexxxx
  280.  
  281.  
  282.      iiiiggggnnnnoooorrrreeeeccccaaaasssseeee   iiiicccc     ignore case of letters in scanning
  283.      lllliiiisssstttt                print ^^^^IIII for tab, $ at end
  284.      mmmmaaaaggggiiiicccc               treat .... [[[[ **** special in patterns
  285.      mmmmooooddddeeeelllliiiinnnneeeessss           first five lines and last five lines executed as
  286.                          _v_i/_e_x commands if they are of the form
  287.                          eeeexxxx::::_c_o_m_m_a_n_d:::: or vvvviiii::::_c_o_m_m_a_n_d::::
  288.      nnnnuuuummmmbbbbeeeerrrr       nnnnuuuu     number lines
  289.      ppppaaaarrrraaaaggggrrrraaaapppphhhhssss   ppppaaaarrrraaaa   macro names that start paragraphs
  290.      rrrreeeeddddrrrraaaawwww              simulate smart terminal
  291.      rrrreeeeppppoooorrrrtttt              informs you if the number of lines modified by the
  292.                          last command is greater than the value of the
  293.                          rrrreeeeppppoooorrrrtttt variable
  294.      ssssccccrrrroooollllllll              command mode lines
  295.      sssseeeeccccttttiiiioooonnnnssss     sssseeeecccctttt   macro names that start sections
  296.      sssshhhhiiiiffffttttwwwwiiiiddddtttthhhh   sssswwww     for <<<< >>>>, and input ^^^^DDDD
  297.      sssshhhhoooowwwwmmmmaaaattttcccchhhh    ssssmmmm     to )))) and }}}} as typed
  298.      sssshhhhoooowwwwmmmmooooddddeeee     ssssmmmmdddd    show insert mode in _v_i
  299.      sssslllloooowwwwooooppppeeeennnn     sssslllloooowwww   stop updates during insert
  300.      tttteeeerrrrmmmm                specifies to vvvviiii the type of terminal being used (the
  301.                          default is the value of the environment variable TTTTEEEERRRRMMMM)
  302.      wwwwiiiinnnnddddoooowwww              visual mode lines
  303.      wwwwrrrraaaappppmmmmaaaarrrrggggiiiinnnn   wwwwmmmm     automatic line splitting
  304.      wwwwrrrraaaappppssssccccaaaannnn     wwwwssss     search around end (or beginning) of buffer
  305.  
  306.    SSSSccccaaaannnnnnnniiiinnnngggg ppppaaaatttttttteeeerrrrnnnn ffffoooorrrrmmmmaaaattttiiiioooonnnn
  307.       ^^^^           beginning of line
  308.       $$$$           end of line
  309.       ....           any character
  310.       \\\\<<<<          beginning of word
  311.       \\\\>>>>          end of word
  312.       [[[[_s_t_r]]]]       any character in _s_t_r
  313.       [[[[^^^^_s_t_r]]]]      any character not in _s_t_r
  314.       [[[[_x-_y]]]]       any character between _x and _y
  315.       ****           any number of preceding characters
  316.  
  317. FFFFIIIILLLLEEEESSSS
  318.      /usr/lib/exrecover          recover command
  319.      /usr/lib/expreserve         preserve command
  320.      /usr/share/lib/terminfo/*   describes capabilities of terminals
  321.      $HOME/.exrc                 editor startup file
  322.      ./.exrc                     editor startup file
  323.      /tmp/Ex_n_n_n_n_n                editor temporary
  324.      /tmp/Rx_n_n_n_n_n                named buffer temporary
  325.  
  326.  
  327.  
  328.  
  329.  
  330.                                                                         PPPPaaaaggggeeee 5555
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337. eeeexxxx((((1111))))                                                                    eeeexxxx((((1111))))
  338.  
  339.  
  340.  
  341.      /usr/preserve/_l_o_g_i_n         preservation directory (where _l_o_g_i_n is the
  342.                                  user's login name)
  343.  
  344. NNNNOOOOTTTTEEEESSSS
  345.      Several options, although they continue to be supported, have been
  346.      replaced in the documentation by options that follow the Command Syntax
  347.      Standard (see _i_n_t_r_o(1)).  The ---- option has been replaced by ----ssss, a ----rrrr
  348.      option that is not followed with an option-argument has been replaced by
  349.      ----LLLL, and ++++_c_o_m_m_a_n_d has been replaced by ----cccc _c_o_m_m_a_n_d.
  350.  
  351.      _e_x has a limit of 15,687,678 editable lines.  Attempts to edit or create
  352.      files larger than this limit cause _e_x to terminate with an appropriate
  353.      error message.
  354.  
  355. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  356.      crypt(1), ctags(1), ed(1), edit(1), grep(1), sed(1), sort(1), vi(1),
  357.      curses(3X), term(4), terminfo(4), regcomp(5).
  358.  
  359. BBBBUUUUGGGGSSSS
  360.      The zzzz command prints the number of logical rather than physical lines.
  361.      More than a screen full of output may result if long lines are present.
  362.  
  363.      File input/output errors do not print a name if the command line ----ssss
  364.      option is used.
  365.  
  366.      There is no easy way to do a single scan ignoring case.
  367.  
  368.      The editor does not warn if text is placed in named buffers and not used
  369.      before exiting the editor.
  370.  
  371.      Null characters are discarded in input files and cannot appear in
  372.      resultant files.
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.                                                                         PPPPaaaaggggeeee 6666
  397.  
  398.  
  399.  
  400.